package com.foodchain.controller;

import com.foodchain.util.Misc;
import com.foodchain.util.Utils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;

@Controller
@RequestMapping("/userBaseMsg")
public class UserBaseMsgController extends BaseController {

    @RequestMapping("/userBaseMsg")
    public String userBaseMsg (Model model) {
        return clientPage("baseMsg/baseMsg");
    }

    private Long getDateDuration (Date startDate, Date endDate) {
        ZoneId zoneId = ZoneId.systemDefault();
        Instant endInstant = endDate.toInstant();
        Instant startInstant = startDate.toInstant();

        return Duration.between(LocalDateTime.ofInstant(startInstant, zoneId),
                LocalDateTime.ofInstant(endInstant, zoneId)).getSeconds();
    }

}
